package com.pwc.conversionTool.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Ignore;
import com.googlecode.objectify.annotation.Index;

@Entity
public class Formula implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5716368746964998167L;

	@Id
	private Long id;

	private List<FilterCondition> filter;

	private List<FormulaCondition> formula;
	
	@Index
	private Key<DataTemplate> dataTemplateKey;
	
	@Ignore
	private Long dataTemplateId;

	


	public Long getDataTemplateId() {
		return dataTemplateId;
	}

	public void setDataTemplateId(Long dataTemplateId) {
		this.dataTemplateId = dataTemplateId;
	}

	



	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public List<FilterCondition> getFilter() {
		return filter;
	}

	public void setFilter(List<FilterCondition> filter) {
		this.filter = filter;
	}

	public List<FormulaCondition> getFormula() {
		return formula;
	}

	public void setFormula(List<FormulaCondition> formula) {
		this.formula = formula;
	}

	@JsonIgnore
	public Key<DataTemplate> getDataTemplateKey() {
		return dataTemplateKey;
	}

	public void setDataTemplateKey(Key<DataTemplate> dataTemplateKey) {
		this.dataTemplateKey = dataTemplateKey;
	}

	
	
	
	@JsonIgnore
	@Transient
	public Key<Formula> getKey() {
		return Key.create(Formula.class, id);
	}

}
